package com.token.zhuishushenqi.community.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.token.zhuishushenqi.community.ui.DynamicFragment;
import com.token.zhuishushenqi.community.ui.MineFragment;
import com.token.zhuishushenqi.community.ui.HotFragment;

/**
 * 社区页面适配器
 * Created by token_zhou on 2016/11/7.
 */

public class CommunityViewpagerAdapter extends FragmentPagerAdapter {

    public CommunityViewpagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        switch (position) {
            case 0:
                return new DynamicFragment();
            case 1:
                return new HotFragment();
            case 2:
                return new MineFragment();
        }
        return null;
    }

    @Override
    public int getCount() {
        return 3;
    }
}
